Return Types for Functional Continuations
نویسندگان
چکیده
We add functional continuations and prompts to a language with an ML-style type system. The operators extend and simplify the control operators in Standard ML of New Jersey (SML/NJ) and Scheme, and can be themselves used to implement (simple) exceptions and references. We prove that well-typed terms never produce run-time type errors, and give a module for implementing functional continuations in SML/NJ.
منابع مشابه
Types for Delimited Control Operators
There are a great variety of control constructs in programming languages: conditionals, goto, coroutines, threads, processes, break, return, and, of course, continuations. The advantage of continuations over the others is that many of the other control constructs are expressible in terms of them. Unfortunately, the global continuations operators (e.g., call/cc) that are implemented in languages...
متن کاملOn typing delimited continuations: three new solutions to the printf problem
In “Functional Unparsing” (JFP 8(6): 621–625, 1998), Danvy presented a type-safe printf function using continuations and an accumulator to achieve the effect of dependent types. The key technique employed in Danvy’s solution is the non-standard use of continuations: not all of its calls are tail calls, i.e., it uses delimited continuations. Against this backdrop, we present three new solutions ...
متن کاملValue Transforming Style
A new program transformation is presented that allows to remove control operators related to partial continuations. The basis for the transformation is to adopt an improved representation for continuations that makes frames apparent. Various examples of control operators with or without dynamic extent stress are presented. Scheme IEE91], ooers rst-class continuations with indeenite extent. Pion...
متن کاملComparing Control Constructs by Double-Barrelled CPS
We investigate call-by-value continuation-passing style transforms that pass two continuations. Altering a single variable in the translation of λ-abstraction gives rise to different control operators: first-class continuations; dynamic control; and (depending on a further choice of a variable) either the return statement of C; or Landin’s J-operator. In each case there is an associated simple ...
متن کاملComparing Control Constructs by Double-barrelled {CPS} Transforms
We investigate continuation-passing style transforms that pass two continuations. Altering a single variable in the translation of λ-abstraction gives rise to different control operators: first-class continuations; dynamic control; and (depending on a further choice of a variable) either the return statement of C; or Landin’s Joperator. In each case there is an associated simple typing. For tho...
متن کامل